package com.jacklin.exception;

import com.jacklin.enums.ResultEnum;
import lombok.Getter;

/**
 * @Author:JackLin
 * @Create 2019/3/29 21:24
 */

@Getter
public class MyException extends RuntimeException{

    private Integer code;

//    private String msg;


    public MyException(ResultEnum resultEnum) {
        super(resultEnum.getMessage());  //把message传到父类的构造方法中去
        this.code = resultEnum.getCode();
    }

    public MyException(Integer code,String message){
        super(message);
        this.code = code;
    }
}
